fix(sandbox): require https for daytona signed preview URLs#3206
Closed
adityasingh2400 wants to merge 1 commit into
Closed
fix(sandbox): require https for daytona signed preview URLs#3206adityasingh2400 wants to merge 1 commit into
adityasingh2400 wants to merge 1 commit into
Conversation
Daytona signed preview URLs are always HTTPS. Treat any non-https scheme as an invalid preview URL instead of silently downgrading to plaintext (tls=False, port 80), which would expose the user's exposed-port traffic over an unauthenticated, unencrypted channel if the backend ever returned an http URL.
3 tasks
Member
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Member
|
This could make sense, but I don't see the necessity to do this on the client SDK side |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DaytonaSandboxSession._resolve_exposed_portaccepted any URL returned bycreate_signed_preview_url— includinghttp://...— and silently exposed it as a non-TLS endpoint (tls=False, port 80). Daytona signed preview URLs are always HTTPS, so a non-https scheme indicates either a backend bug or a tampered response. Either way, downstream code would then connect over plaintext to a host derived from that URL.This change rejects any preview URL whose scheme is not
https, raisingExposedPortUnavailableErrorwith the existinginvalid_preview_urldetail (same path already used for malformed URLs).This is in the same vein as #3094 / #3172 / #3177 — defensive narrowing of what a sandbox backend will trust from the wire.
Diff
src/agents/extensions/sandbox/daytona/sandbox.py: 4 lines changed (require https, drop the http fallback fortls/port).tests/extensions/sandbox/test_daytona.py: newtest_resolve_exposed_port_rejects_non_https_preview_urlcovering the regression.Test plan
test_resolve_exposed_port_rejects_non_https_preview_urlfails onmainand passes after the fix.tests/extensions/sandbox/test_daytona.pysuite (54 tests) passes.ruff checkandruff format --checkclean on both files.🤖 Generated with Claude Code